package org.liveboardgames.agricola.business.updater;

import java.util.List;

import org.liveboardgames.agricola.domain.Change;
import org.liveboardgames.agricola.domain.board.BoardTile;
import org.liveboardgames.agricola.domain.card.ActionCard;
import org.liveboardgames.agricola.model.enums.ChangesEnum;

public class BoardTileUpdater extends AbstractUpdater {

  private BoardTile tile;

  public BoardTileUpdater(BoardTile tile, List<Change> changes) {
    super(changes);
    this.tile = tile;
  }

  public void updateActionCard(ActionCard actionCard) {
    tile.setActionCard(actionCard);
    Change change = new Change(ChangesEnum.BOARD_TILE, tile);
    addChange(change);
  }

  public void addResource(String resourceType, int quantity) {
    tile.addResource(resourceType, quantity);
    Change change = new Change(ChangesEnum.BOARD_TILE, tile);
    addChange(change);
  }

}
